package adventure.placeable.trigger.conditions;

import player.Player;
import adventure.room.RoomManager;


/**
 *
 * @author Michael Hanns
 *
 */
public abstract class TriggerCondition implements Cloneable {

    protected String condition;
    protected String dependant;
    protected boolean not;
    
    public TriggerCondition(String condition, String dependant, boolean not) {
        this.condition = condition;
        this.dependant = dependant;
        this.not = not;
    }

    public String getCondition() {
        return condition;
    }

    public String getDependant() {
        return dependant;
    }
    
    public boolean not() {
        return not;
    }

    public abstract String getDescription();

    public abstract boolean meetsCondition(RoomManager r, Player p, String i, boolean previousFailed);

    public abstract boolean isUserSpecified();
    
    public TriggerCondition cloneThis() {
        TriggerCondition newClone = null;
        try {
            newClone = (TriggerCondition) this.clone();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return newClone;
    }

}
